 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"         
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:fragment xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:a4j="http://richfaces.org/a4j">
	
	<h:panelGrid id="menuPanel" cellpadding="0" cellspacing="0" width="250" rendered="#{!empty usuarioMB.usuario}">
		<h:form id="menuForm">
			<rich:panelMenu
				groupExpandedLeftIcon="triangleUp"
				groupCollapsedLeftIcon="triangleDown"
				topGroupExpandedRightIcon="chevronUp"
				topGroupCollapsedRightIcon="chevronDown"
				itemLeftIcon="grid"
				expandSingle="false">
				<rich:panelMenuGroup expanded="true">
					<f:facet name="label">
						<span class="rf-p-hdr" style="border: none; background: transparent;">
							<h:outputText value="Cadastros"/>
						</span>
					</f:facet>
					<rich:panelMenuGroup label="Empresa" expanded="true">
						<rich:panelMenuItem label="Cadastrar" action="#{empresaMB.cadastrar}" rendered="#{usuarioMB.usuarioAdministrador}" mode="server"/>
						<rich:panelMenuItem label="Pesquisar" action="/pages/empresa/pesquisarEmpresa.xhtml" mode="server"/>
					</rich:panelMenuGroup>
					<rich:panelMenuGroup label="Funcionario" expanded="true">
						<rich:panelMenuItem label="Cadastrar" action="#{funcionarioMB.cadastrar}" rendered="#{usuarioMB.usuarioAdministrador}"  mode="server"/>
						<rich:panelMenuItem label="Pesquisar" action="/pages/funcionario/pesquisarFuncionario.xhtml"  mode="server"/>
					</rich:panelMenuGroup>
					<rich:panelMenuGroup label="Feriado" expanded="true">
						<rich:panelMenuItem label="Cadastrar" action="#{feriadoMB.cadastrar}" rendered="#{usuarioMB.usuarioAdministrador}"  mode="server"/>
						<rich:panelMenuItem label="Pesquisar" action="/pages/feriado/pesquisarFeriado.xhtml"  mode="server"/>
					</rich:panelMenuGroup>
				</rich:panelMenuGroup>
				
				<rich:panelMenuGroup expanded="true">
					<f:facet name="label">
						<span class="rf-p-hdr" style="border: none; background: transparent;">
							<h:outputText value="Ponto"/>
						</span>
					</f:facet>
					<rich:panelMenuItem label="Lançar Horas" action="#{pontoMB.calcular}" rendered="#{usuarioMB.usuarioAdministrador}"  mode="server"/>
					<rich:panelMenuItem label="Converter Unidades" mode="client" onclick="#{rich:component('calculadora')}.show(); return false;"/>
				</rich:panelMenuGroup>
			</rich:panelMenu>
		</h:form>
	</h:panelGrid>
	
	<ui:include src="/default/calculadora.xhtml"/>
	
</ui:fragment>